<script type="text/javascript">
var index='${(index)!''}';
$(function () {
	$.ajaxSetup({cache: false});
	queryOrgan();
});

function queryOrgan(page) {
	var parm = $('#queryOrganForm').serialize() + (page != null ? ('&page=' + page) : '');
	var url = create_url('parkorgan-batchOrganList');
	sys_loading();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_loading_close();
			$('#resultList').html(result);
		}
	});
}



$(".txt_userlist_name").keydown(function(event) {
	if (event.keyCode == '13') {
		queryOrgan();
		return false;
	}
});
function deleteTr(t){
	t.parent().parent().remove();
}
function selectCheckbox(xuan,code,name){
	if(xuan.attr("checked")=='checked'){
		var newRow="<tr id='--"+ code +"' class='ui-widget-content'><td><input type='text' value='" + name + "' name='list["+ index +"].name' readonly='readonly' /></td>"+
		"<input type='hidden' value='"+ code +"' name='list["+ index +"].oc'/><td><input type='text' id='sort' name='list["+ index +"].sort' onchange='checkedSort($(this))' class='sort'/></td>"+
		"<div class='btn-group'><td><a class='btn btn-xs btn-danger' href='javascript:;' onclick='deleteTr($(this))'><i class='icon-remove'></i></a></div></td></tr>";
		$("#newTable").append(newRow);
		index++;
	}else {
		$("#--"+code).remove();
	}
}

function closeBox(){
	$("#index").val(index);
	$.fn.colorbox.close()
}
</script>

<#import "/freemarker/modeltype.ftl" as mt>
<#import "/freemarker/modeltype_entity.ftl" as mte><!-- 导入freemarker -->
<div class="ui-widget-content" >
	<form id="queryOrganForm">
		<table class="search_term_table" style="width: 450px">
			<input type="hidden" name="deleted" value="false"/>
			<tr>
				<td>企业名称</td>
				<td><input type="text"  class="txt_userlist_name" name="name" /></td>
				<td style="text-align:right;"><a class="btn btn-info" href="javascript:queryOrgan();"><i class="fontello-icon-search-3"></i>查 询</a></td>
				<td style="text-align:right;padding-left:50px"><a class="btn btn-info" onclick="javasrcipt:closeBox();"><i class="fontello-icon-search-3"></i>确定</a></td>
			</tr>
		</table>
	</form>
	<div id="resultList"></div>
</div